#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
typedef struct BTNode {
	char val;//note that this is a string
	struct BTNode* right;
	struct BTNode* left;
}BTNode;

BTNode* Creat(char* a, int* pi)
{
	if (a[*pi] == '#')
	{
		(*pi)++;
		return NULL;
	}
	BTNode* root = (BTNode*)malloc(sizeof(BTNode));
	root->left = Creat(a, pi);
	root->right = Creat(a, pi);
	return root;
}

void Inorder(BTNode* root)
{
	if (root)
	{
		Inorder(root->left);
		printf("%d", root->val);
		Inorder(root->right);
	}
}

int main()
{
	char a[101];
	scanf("%s", &a);
	int count=0;
	BTNode* root = Creat(a, &count);
	Inorder(root);
	return 0;
}